<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>使用伪属性传参配置</title>
    <link rel="stylesheet" type="text/css" href="http://docs.kissyui.com/kissy-dpl/base/build/css/dpl-pkg.css"/>
    <link rel="stylesheet" type="text/css" href="../../assets/demo.css"/>
    <script src="http://a.tbcdn.cn/s/kissy/1.2.0/kissy-min.js" charset="utf-8"></script>
</head>
<body>
<article id="doc">
    <h4>使用伪属性传参配置</h4>
    <!-- 上传按钮，组件配置请写在data-config内 -->
    <a id="J_UploaderBtn" class="uploader-button" data-config=
            '{
                 "serverConfig":{"action":"upload.php","data":{"username":"minghe"}},
                    "name":"Filedata",
                    "urlsInputName":"fileUrls"
                }'
       href="#">
        选择要上传的文件
    </a>
    <!-- 文件上传队列 -->
    <ul id="J_UploaderQueue">

    </ul>
    <p>demo详细说明，请看<a href="http://www.36ria.com/5072#dataConfig" target="_blank">《组件配置方式和关键配置—KF/Uploader快速使用指南》</a></p>
    <h5>demo代码如下：</h5>
    <pre class='brush: js;html-script: true '>
        <!-- 上传按钮，组件配置请写在data-config内 -->
        <a id="J_UploaderBtn" class="uploader-button" data-config=
                '{
                     "serverConfig":{"action":"upload.php","data":{"username":"minghe"}},
                        "name":"Filedata",
                        "urlsInputName":"fileUrls"
                    }'
           href="#">
            选择要上传的文件
        </a>
        <!-- 文件上传队列 -->
        <ul id="J_UploaderQueue">

        </ul>
        <script>
            var S = KISSY,
                //包路径，实际使用请直接配置为"http://a.tbcdn.cn/s/kissy/"
                    path = S.Config.debug && "../../../../../../" || "http://a.tbcdn.cn/s/kissy/";
            S.config({
                packages:[ {
                    name:"gallery",
                    path:path,
                    charset:"utf-8"
                } ]
            });
            //加载上传组件入口文件
            KISSY.use('gallery/form/1.3/uploader/index', function (S, RenderUploader) {
                //第一个参数：按钮元素钩子，第二个参数：队列元素钩子
                new RenderUploader('#J_UploaderBtn', '#J_UploaderQueue');
            })
        </script>
     </pre>
</article>
<!-- 代码高亮 START  -->
<link href='../../assets/syntaxhighlighter_3.0.83/sh.css' rel='stylesheet' type='text/css'/>
<script type="text/javascript" src="../../assets/syntaxhighlighter_3.0.83/sh.js"></script>
<script type="text/javascript">SyntaxHighlighter.all();</script>
<!-- 代码高亮 END  -->
</body>
</html>
